home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / os2 / octa209s.zip / octave-2.09 / liboctave / CmplxSVD.h < prev    next >
C/C++ Source or Header  |  1996-03-03  |  2KB  |  96 lines

  1. /*
  2.  
  3. Copyright (C) 1996 John W. Eaton
  4.  
  5. This file is part of Octave.
  6.  
  7. Octave is free software; you can redistribute it and/or modify it
  8. under the terms of the GNU General Public License as published by the
  9. Free Software Foundation; either version 2, or (at your option) any
  10. later version.
  11.  
  12. Octave is distributed in the hope that it will be useful, but WITHOUT
  13. ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  14. FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  15. for more details.
  16.  
  17. You should have received a copy of the GNU General Public License
  18. along with Octave; see the file COPYING.  If not, write to the Free
  19. Software Foundation, 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  20.  
  21. */
  22.  
  23. #if !defined (octave_ComplexSVD_h)
  24. #define octave_ComplexSVD_h 1
  25.  
  26. #if defined (__GNUG__)
  27. #pragma interface
  28. #endif
  29.  
  30. class ostream;
  31.  
  32. #include "dDiagMatrix.h"
  33. #include "CMatrix.h"
  34. #include "dbleSVD.h"
  35.  
  36. class
  37. ComplexSVD
  38. {
  39. public:
  40.  
  41.   ComplexSVD (void) { }
  42.  
  43.   ComplexSVD (const ComplexMatrix& a, SVD::type svd_type = SVD::std)
  44.     {
  45.       init (a, svd_type);
  46.     }
  47.  
  48.   ComplexSVD (const ComplexMatrix& a, int& info,
  49.           SVD::type svd_type = SVD::std)
  50.     {
  51.       info = init (a, svd_type);
  52.     }
  53.  
  54.   ComplexSVD (const ComplexSVD& a)
  55.     : sigma (a.sigma), left_sm (a.left_sm), right_sm (a.right_sm) { }
  56.  
  57.   ComplexSVD& operator = (const ComplexSVD& a)
  58.     {
  59.       if (this != &a)
  60.     {
  61.       sigma = a.sigma;
  62.       left_sm = a.left_sm;
  63.       right_sm = a.right_sm;
  64.     }
  65.       return *this;
  66.     }
  67.  
  68.   ~ComplexSVD (void) { }
  69.  
  70.   DiagMatrix singular_values (void) const { return sigma; }
  71.  
  72.   ComplexMatrix left_singular_matrix (void) const;
  73.  
  74.   ComplexMatrix right_singular_matrix (void) const;
  75.  
  76.   friend ostream&  operator << (ostream& os, const ComplexSVD& a);
  77.  
  78. private:
  79.  
  80.   SVD::type type_computed;
  81.  
  82.   DiagMatrix sigma;
  83.   ComplexMatrix left_sm;
  84.   ComplexMatrix right_sm;
  85.  
  86.   int init (const ComplexMatrix& a, SVD::type svd_type = SVD::std);
  87. };
  88.  
  89. #endif
  90.  
  91. /*
  92. ;;; Local Variables: ***
  93. ;;; mode: C++ ***
  94. ;;; End: ***
  95. */
  96.